package emulator.unittest.hardware.nmos6502;

import emulator.hardware.bus.Bus;
import emulator.hardware.memory.UnmappedMemoryException;

public class MockMemory implements Bus {
	
	private int last_address;
	private int last_data;
	private int write_count;

	@Override
	public int read(int address) throws UnmappedMemoryException {
		return address & 0xff;
	}

	@Override
	public void write(int address, int data) {
		last_address = address;
		last_data = data;
		write_count++;
	}

	public int getLastAddress() {
		return last_address;
	}

	public int getLastData() {
		return last_data;
	}

	public int getWriteCount() {
		return write_count;
	}

}
